

    \filetitle{SVAR}{Convert reduced-form VAR to structural VAR}{SVAR/SVAR}

	\paragraph{Syntax}\label{syntax}

\begin{verbatim}
[S,DATA,B,COUNT] = SVAR(V,DATA,...)
\end{verbatim}

\paragraph{Input arguments}\label{input-arguments}

\begin{itemize}
\item
  \texttt{V} {[} VAR {]} - Reduced-form VAR object.
\item
  \texttt{DATA} {[} struct \textbar{} tseries {]} - Data associated with
  the input VAR object.
\end{itemize}

\paragraph{Output arguments}\label{output-arguments}

\begin{itemize}
\item
  \texttt{S} {[} VAR {]} - Structural VAR object.
\item
  \texttt{DATA} {[} struct \textbar{} tseries {]} - Data with
  transformed structural residuals.
\item
  \texttt{B} {[} numeric {]} - Impact matrix of structural residuals.
\item
  \texttt{COUNT} {[} numeric {]} - Number of draws actually performed
  (both successful and unsuccessful) when \texttt{'method'='draw'};
  otherwise \texttt{COUNT=1}.
\end{itemize}

\paragraph{Options}\label{options}

\begin{itemize}
\item
  \texttt{'maxIter='} {[} numeric \textbar{} \emph{\texttt{0}} {]} -
  Maximum number of attempts when \texttt{'method'='draw'}.
\item
  \texttt{'method='} {[} \emph{\texttt{'chol'}} \textbar{}
  \texttt{'householder'} \textbar{} \texttt{'qr'} \textbar{}
  \texttt{'svd'} {]} - Method that will be used to identify structural
  VAR and structural shocks.
\item
  \texttt{'nDraw='} {[} numeric \textbar{} \emph{\texttt{0}} {]} -
  Target number of successful draws when \texttt{'method'='draw'}.
\item
  \texttt{'reorder='} {[} numeric \textbar{} \emph{empty} {]} - Reorder
  VAR variables before identifying structural shocks, and bring the
  variables back in original order afterwards. Use the option
  '\texttt{backorderResiduals='} to control if also the structural
  shocks are to be brought back in original order.
\item
  \texttt{'output='} {[} \emph{\texttt{'auto'}} \textbar{}
  \texttt{'dbase'} \textbar{} \texttt{'tseries'} {]} - Format of output
  data.
\item
  \texttt{'progress='} {[} \texttt{true} \textbar{}
  \emph{\texttt{false}} {]} - Display progress bar in the command
  window.
\item
  \texttt{'rank='} {[} numeric \textbar{} \emph{\texttt{Inf}} {]} -
  Reduced rank of the covariance matrix of structural residuals when
  \texttt{'method=' 'svd'}; \texttt{Inf} means full rank is preserved.
\item
  \texttt{'backOrderResiduals='} {[} \emph{\texttt{true}} \textbar{}
  \texttt{false} {]} - Bring the identified structural shocks back in
  original order after identification; works with \texttt{'reorder='}.
\item
  \texttt{'std='} {[} numeric \textbar{} \emph{\texttt{1}} {]} - Std
  deviation of structural residuals; the resulting structural covariance
  matrix will be re-scaled (divided) by this factor.
\item
  \texttt{'test='} {[} char {]} - Works with \texttt{'method=draw'}
  only; a string that will be evaluated for each random draw of the
  impact matrix \texttt{B}. The evaluation must result in \texttt{true}
  or \texttt{false}; only the matrices \texttt{B} that evaluate to
  \texttt{true} will be kept. See Description for more on how to write
  the option \texttt{'test='}.
\end{itemize}

\paragraph{Description}\label{description}

\subparagraph{Identification random Householder
transformations}\label{identification-random-householder-transformations}

The structural impact matrices \texttt{B} are randomly generated using a
Householder transformation algorithm. Each matrix is tested by
evaluating the \texttt{test} string supplied by the user. If it
evaluates to true the matrix is kept and one more SVAR parameterisation
is created, if it is false the matrix is discarded.

The \texttt{test} string can refer to the following characteristics:

\begin{itemize}
\item
  \texttt{S} -- the impulse (or shock) response function; the
  \texttt{S(i,j,k)} element is the response of the \texttt{i}-th
  variable to the \texttt{j}-th shock in period \texttt{k}.
\item
  \texttt{Y} -- the asymptotic cumulative response function; the
  \texttt{Y(i,j)} element is the asumptotic (long-run) cumulative
  response of the \texttt{i}-th variable to the \texttt{j}-th shock.
\end{itemize}

\paragraph{Example}\label{example}


